﻿using System;
using System.ComponentModel;
using System.Linq.Expressions;

namespace DailyFx.UI
{
	public interface IConfiguration : INotifyPropertyChanged
	{
		//TODO: It should support children nodes, not implement yet. 
		IConfiguration Create();
		void Clear();

		Boolean HasProperty( String name);
		
		Object GetProperty( String name);
		Object GetProperty( String name, Object @default);

		T GetProperty<T>( String name);
		T GetProperty<T>( String name, T @default );

		IConfiguration SetProperty( String name, Object value);
		IConfiguration SetProperty( String name, Object value, Object @default);

		void DeleteProperty (string name);

		//Load & Save all specific properties
		void LoadProperty<T>(T t, params Expression<Func<T, Object>>[] props);
		void SaveProperty<T>(T t, params Expression<Func<T, Object>>[] props);
	}
}
